package com.liu.manager.bean;

import lombok.Data;

import java.io.Serializable;

@Data
public class ResponseResult implements Serializable {

    private int code;
    private String msg;
    private Object result;

    public static ResponseResult OK(){
        return ResponseResult.OK("操作成功");
    }

    public static ResponseResult OK(String msg){
        ResponseResult responseResult = new ResponseResult();
        responseResult.setCode(100);
        responseResult.setMsg(msg);
        return responseResult;
    }

    public static ResponseResult ERROR(){
        return ResponseResult.ERROR("操作失败");
    }

    public static ResponseResult ERROR(String msg){
        ResponseResult responseResult = new ResponseResult();
        responseResult.setCode(-100);
        responseResult.setMsg(msg);
        return responseResult;
    }
}
